package com.liankuan.console.repository;

import com.liankuan.console.dto.UserExchange;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface UserExchangeRepository extends JpaRepository<UserExchange, Integer> {

    /**
     * 获取用户对于的所有交易所
     *
     * @param userId
     * @return
     */
    List<UserExchange> findAllByUserId(Integer userId);

    /**
     * 根据用户id和交易所id进行关联表的删除
     *
     * @param userId
     * @param ExchangeId
     */
    void deleteByUserIdAndExchangeId(int userId, int ExchangeId);

    void deleteAllByUserId(int userId);

    void deleteAllByExchangeId(int exchangeId);
}
